Repository navigation
Class fallback chains (second-pass escalation, visited-set semantics) + guard extension - #9385
Merged
Merged
Conversation
Drew 2026-11-13 (final edges + pinned semantics). Edges wired as the final targets of each class route: small -> speed; speed -> workhorse, summit, specialist; workhorse -> scout, specialist (scout first per main recommendation - failure mode is quota exhaustion, scout diversifies doors); summit -> specialist; specialist = sink; scout -> workhorse and background -> workhorse as marked PROPOSALS. Semantics: regular chain first and completely, fallback as second pass on exhaustion only, walked transitively under a per-call visited set (fork route expander prunes re-entry into a route already on the expansion path; exhausted subtrees resume the caller remaining edges), terminating at specialist. Guard extended: declared-chain drift check, sink reachability, simulated escalation walk, whole-graph composition cycle check excluding declared fallback pairs; tier resolver no longer reports declared fallback re-entries as cycles. Full per-route layout: .opencode/route-fallbacks.md (all 34 routes). No restart - rides the coordinated switch.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drew 2026-11-13. Implements the confirmed class fallback edges as the FINAL targets of each class route (regular chain first, completely; fallback = second pass on exhaustion only):
Semantics (Drew, pinned 2026-11-13): per-call visited set — a class already tried in the call is never re-entered; the walk is transitive and depth-first (an exhausted fallback subtree resumes the caller's remaining edges), terminating at specialist. Mechanism is the existing machinery, not new proxy code: the fork's route expander (model-routes plugin) carries the expansion path and prunes re-entry into a route already on it, which is exactly the visited-set rule; the workhorse stage chain already proves last-target escalation.
Guard (bin/check-opencode-route-rules.mjs): CLASS_FALLBACKS table kept in lockstep with the config — (a) drift check: each class route must end with its declared chain; (b) every class reaches specialist through the fallback graph; (c) simulated escalation walk (depth-first, visited set) reaches specialist from every class; (d) static cycle check over the whole composition graph EXCLUDING declared fallback pairs, reporting the cycle path. The tier resolver no longer flags declared fallback re-entries (workhorse<->scout) as model-route cycles. The walk simulation caught and fixed a real modeling bug during development (greedy first-edge walk strands at scout; the true router semantics resume the caller's chain).
Full layout for all 34 routes (classes, stages, *-plan door failover, provider routes): .opencode/route-fallbacks.md, added in this PR.
Tests: 97 pass / 0 fail across the guard suites, including 5 new fallback tests (layout pass, drift, composition cycle path, reachability, walk). Canonical config passes the extended guard. No restart; rides the coordinated switch.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.